home *** CD-ROM | disk | FTP | other *** search
- package com.supercede.forms;
-
- import java.awt.CheckboxGroup;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.io.Serializable;
- import java.util.Vector;
-
- public class SuperCedeDesignInfo implements Serializable {
- protected boolean multithreaded = false;
- protected Vector radioGroupList = new Vector();
- public static final int VERTICAL = 0;
- public static final int HORIZONTAL = 1;
- protected boolean preferencesSet = false;
- protected Dimension absoluteSize;
- protected Vector componentList;
- private long nextComponentID = 1L;
- protected long leftMargin;
- protected long rightMargin;
- protected long topMargin;
- protected long bottomMargin;
- private long nextGuideID = 1L;
- protected Vector guideList;
- protected Color marginColor;
- protected Color guideColor;
- protected Color[] customColor;
- protected boolean markSnap;
- protected long markSpacing;
- protected long gravity;
- protected long rulerZoneSize;
- protected boolean tabOrderVisible;
- protected boolean rulersVisible;
- protected boolean rulerTicksVisible;
- protected boolean statusBarVisible;
- protected boolean toolbarVisible;
- protected boolean javaPaletteVisible;
- protected boolean activeXPaletteVisible;
- private static final long serialVersionUID = 1013082004010516617L;
- private static final int _version = 1;
- private int version = 1;
-
- public SuperCedeDesignInfo() {
- this.addRadioGroup("group1");
- this.componentList = new Vector();
- this.absoluteSize = new Dimension(300, 160);
- this.leftMargin = 0L;
- this.rightMargin = 0L;
- this.topMargin = 0L;
- this.bottomMargin = 0L;
- this.guideList = new Vector();
- this.marginColor = new Color(128, 0, 128);
- this.guideColor = new Color(64, 128, 128);
- this.customColor = new Color[16];
-
- for(int var1 = 0; var1 < this.customColor.length; ++var1) {
- this.customColor[var1] = Color.white;
- }
-
- this.markSnap = false;
- this.markSpacing = 10L;
- this.gravity = 200L;
- this.rulerZoneSize = 1200L;
- this.tabOrderVisible = false;
- this.rulersVisible = true;
- this.rulerTicksVisible = true;
- this.statusBarVisible = true;
- this.toolbarVisible = true;
- this.javaPaletteVisible = true;
- this.activeXPaletteVisible = true;
- }
-
- public boolean isMultithreaded() {
- return this.multithreaded;
- }
-
- public void setMultithreaded(boolean var1) {
- this.multithreaded = var1;
- }
-
- public synchronized void addRadioGroup(String var1) {
- if (this.findRadioGroup(var1) < 0) {
- this.radioGroupList.addElement(new RadioGroupInfo(var1, new CheckboxGroup()));
- }
-
- }
-
- public synchronized boolean removeRadioGroup(String var1) {
- int var3 = this.findRadioGroup(var1);
- boolean var2;
- if (var3 < 0) {
- var2 = false;
- } else {
- try {
- this.radioGroupList.removeElementAt(var3);
- var2 = true;
- } catch (ArrayIndexOutOfBoundsException var4) {
- var2 = false;
- }
- }
-
- return var2;
- }
-
- public synchronized CheckboxGroup getRadioGroup(String var1) {
- int var3 = this.findRadioGroup(var1);
- CheckboxGroup var2;
- if (var3 < 0) {
- var2 = null;
- } else {
- try {
- RadioGroupInfo var4 = (RadioGroupInfo)this.radioGroupList.elementAt(var3);
- var2 = var4.radioGroup;
- } catch (ArrayIndexOutOfBoundsException var5) {
- var2 = null;
- }
- }
-
- return var2;
- }
-
- public synchronized String[] getRadioGroupNames() {
- int var2 = this.radioGroupList.size();
- String[] var1;
- if (var2 == 0) {
- var1 = null;
- } else {
- var1 = new String[var2];
-
- for(int var3 = 0; var3 < var2; ++var3) {
- RadioGroupInfo var4;
- try {
- var4 = (RadioGroupInfo)this.radioGroupList.elementAt(var3);
- } catch (ArrayIndexOutOfBoundsException var5) {
- var4 = null;
- }
-
- var1[var3] = var4.name;
- }
- }
-
- return var1;
- }
-
- public boolean preferencesAreApplied() {
- return this.preferencesSet;
- }
-
- public void initializedFromPreferences() {
- this.preferencesSet = true;
- }
-
- public Dimension getAbsoluteSize() {
- return this.absoluteSize;
- }
-
- public void setAbsoluteSize(Dimension var1) {
- this.absoluteSize = var1;
- }
-
- public int getComponentCount() {
- return this.componentList.size();
- }
-
- public synchronized long addComponent(Component var1) {
- long var2 = (long)(this.nextComponentID++);
- this.componentList.addElement(new ComponentInfo(var2, var1));
- return var2;
- }
-
- public void addComponent(long var1, Component var3) {
- this.componentList.addElement(new ComponentInfo(var1, var3));
- }
-
- public void removeComponent(int var1) throws ArrayIndexOutOfBoundsException {
- try {
- this.componentList.removeElementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var3) {
- throw var3;
- }
- }
-
- public int findComponent(long var1) {
- int var3 = 0;
-
- int var4;
- for(var4 = this.getComponentCount(); var3 < var4; ++var3) {
- ComponentInfo var5;
- try {
- var5 = (ComponentInfo)this.componentList.elementAt(var3);
- } catch (ArrayIndexOutOfBoundsException var6) {
- var5 = null;
- }
-
- if (var5 == null) {
- var3 = var4;
- break;
- }
-
- if (var5.id == var1) {
- break;
- }
- }
-
- return var3 >= var4 ? -1 : var3;
- }
-
- public int findComponent(Component var1) {
- int var2 = 0;
-
- int var3;
- for(var3 = this.getComponentCount(); var2 < var3; ++var2) {
- ComponentInfo var4;
- try {
- var4 = (ComponentInfo)this.componentList.elementAt(var2);
- } catch (ArrayIndexOutOfBoundsException var5) {
- var4 = null;
- }
-
- if (var4 == null) {
- var2 = var3;
- break;
- }
-
- if (var4.component == var1) {
- break;
- }
- }
-
- return var2 >= var3 ? -1 : var2;
- }
-
- public Component getComponent(int var1) throws ArrayIndexOutOfBoundsException {
- ComponentInfo var2;
- try {
- var2 = (ComponentInfo)this.componentList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
-
- return var2.component;
- }
-
- public long getComponentID(int var1) throws ArrayIndexOutOfBoundsException {
- ComponentInfo var2;
- try {
- var2 = (ComponentInfo)this.componentList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
-
- return var2.id;
- }
-
- public long getLeftMargin() {
- return this.leftMargin;
- }
-
- public void setLeftMargin(long var1) {
- this.leftMargin = var1;
- }
-
- public long getRightMargin() {
- return this.rightMargin;
- }
-
- public void setRightMargin(long var1) {
- this.rightMargin = var1;
- }
-
- public long getTopMargin() {
- return this.topMargin;
- }
-
- public void setTopMargin(long var1) {
- this.topMargin = var1;
- }
-
- public long getBottomMargin() {
- return this.bottomMargin;
- }
-
- public void setBottomMargin(long var1) {
- this.bottomMargin = var1;
- }
-
- public int getGuideCount() {
- return this.guideList.size();
- }
-
- public synchronized long addGuide(int var1, long var2) {
- long var4 = (long)(this.nextGuideID++);
- this.guideList.addElement(new GuideInfo(var1, var4, var2));
- return var4;
- }
-
- public void addGuide(long var1, int var3, long var4) {
- this.guideList.addElement(new GuideInfo(var3, var1, var4));
- }
-
- public void removeGuide(int var1) throws ArrayIndexOutOfBoundsException {
- try {
- this.guideList.removeElementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var3) {
- throw var3;
- }
- }
-
- public int findGuide(long var1) {
- int var3 = 0;
-
- int var4;
- for(var4 = this.getGuideCount(); var3 < var4; ++var3) {
- GuideInfo var5;
- try {
- var5 = (GuideInfo)this.guideList.elementAt(var3);
- } catch (ArrayIndexOutOfBoundsException var6) {
- var5 = null;
- }
-
- if (var5 == null) {
- var3 = var4;
- break;
- }
-
- if (var5.id == var1) {
- break;
- }
- }
-
- return var3 >= var4 ? -1 : var3;
- }
-
- public int getGuideAspect(int var1) throws ArrayIndexOutOfBoundsException {
- GuideInfo var2;
- try {
- var2 = (GuideInfo)this.guideList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
-
- return var2.aspect;
- }
-
- public long getGuideID(int var1) throws ArrayIndexOutOfBoundsException {
- GuideInfo var2;
- try {
- var2 = (GuideInfo)this.guideList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
-
- return var2.id;
- }
-
- public long getGuidePosition(int var1) throws ArrayIndexOutOfBoundsException {
- GuideInfo var2;
- try {
- var2 = (GuideInfo)this.guideList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
-
- return var2.position;
- }
-
- public void setGuidePosition(int var1, long var2) throws ArrayIndexOutOfBoundsException {
- GuideInfo var4;
- try {
- var4 = (GuideInfo)this.guideList.elementAt(var1);
- } catch (ArrayIndexOutOfBoundsException var6) {
- throw var6;
- }
-
- var4.position = var2;
- }
-
- public Color getMarginColor() {
- return this.marginColor;
- }
-
- public void setMarginColor(Color var1) {
- this.marginColor = var1;
- }
-
- public Color getGuideColor() {
- return this.guideColor;
- }
-
- public void setGuideColor(Color var1) {
- this.guideColor = var1;
- }
-
- public int getCustomColorCount() {
- return this.customColor.length;
- }
-
- public Color getCustomColor(int var1) throws ArrayIndexOutOfBoundsException {
- try {
- return this.customColor[var1];
- } catch (ArrayIndexOutOfBoundsException var3) {
- throw var3;
- }
- }
-
- public void setCustomColor(int var1, Color var2) throws ArrayIndexOutOfBoundsException {
- try {
- this.customColor[var1] = var2;
- } catch (ArrayIndexOutOfBoundsException var4) {
- throw var4;
- }
- }
-
- public boolean getMarkSnap() {
- return this.markSnap;
- }
-
- public void setMarkSnap(boolean var1) {
- this.markSnap = var1;
- }
-
- public long getMarkSpacing() {
- return this.markSpacing;
- }
-
- public void setMarkSpacing(long var1) {
- this.markSpacing = var1;
- }
-
- public long getGravity() {
- return this.gravity;
- }
-
- public void setGravity(long var1) {
- this.gravity = var1;
- }
-
- public long getRulerZoneSize() {
- return this.rulerZoneSize;
- }
-
- public void setRulerZoneSize(long var1) {
- this.rulerZoneSize = var1;
- }
-
- public boolean isTabOrderVisible() {
- return this.tabOrderVisible;
- }
-
- public void setTabOrderVisible(boolean var1) {
- this.tabOrderVisible = var1;
- }
-
- public boolean isRulersVisible() {
- return this.rulersVisible;
- }
-
- public void setRulersVisible(boolean var1) {
- this.rulersVisible = var1;
- }
-
- public boolean isRulerTicksVisible() {
- return this.rulerTicksVisible;
- }
-
- public void setRulerTicksVisible(boolean var1) {
- this.rulerTicksVisible = var1;
- }
-
- public boolean isStatusBarVisible() {
- return this.statusBarVisible;
- }
-
- public void setStatusBarVisible(boolean var1) {
- this.statusBarVisible = var1;
- }
-
- public boolean isToolbarVisible() {
- return this.toolbarVisible;
- }
-
- public void setToolbarVisible(boolean var1) {
- this.toolbarVisible = var1;
- }
-
- public boolean isJavaPaletteVisible() {
- return this.javaPaletteVisible;
- }
-
- public void setJavaPaletteVisible(boolean var1) {
- this.javaPaletteVisible = var1;
- }
-
- public boolean isActiveXPaletteVisible() {
- return this.activeXPaletteVisible;
- }
-
- public void setActiveXPaletteVisible(boolean var1) {
- this.activeXPaletteVisible = var1;
- }
-
- private int findRadioGroup(String var1) {
- int var2 = 0;
-
- int var3;
- for(var3 = this.radioGroupList.size(); var2 < var3; ++var2) {
- RadioGroupInfo var4;
- try {
- var4 = (RadioGroupInfo)this.radioGroupList.elementAt(var2);
- } catch (ArrayIndexOutOfBoundsException var5) {
- var4 = null;
- }
-
- if (var4 == null) {
- var2 = var3;
- break;
- }
-
- if (var4.name.equals(var1)) {
- break;
- }
- }
-
- return var2 >= var3 ? -1 : var2;
- }
- }
-